package com.lightningtrade.mapper;

import com.lightningtrade.domain.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface SysUserMapper {

    int insertUser(SysUser sysUser);

    SysUser getUserByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    SysUser getUserByUsername(@Param("username") String username);

    SysUser getUserByUid(@Param("uid") String uid);

    int updateUser(SysUser sysUser);

    int updateUserRole(@Param("uid") Integer uid, @Param("role") String role);

    int deleteUser(@Param("uid") Integer uid);

    int updatePasswordByEmail(@Param("phone") String phone, @Param("oldPassword") String oldPassword, @Param("newPassword") String newPassword);
}
